# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/app-office/scribus/scribus-cvs-0.3.ebuild,v 1.2cvs 2004/09/19 10:38:25 hanno, gray, smith Exp $

inherit cvs kde-functions
need-qt 3

DESCRIPTION="Desktop Publishing (DTP) and Layout program for Linux."
HOMEPAGE="http://web2.altmuehlnet.de/fschmid/"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~sparc"
IUSE="kde"

ECVS_SERVER="ahnews.music.salford.ac.uk:/cvs"
ECVS_USER="anoncvs"
ECVS_PASS="anoncvs"
ECVS_MODULE="Scribus"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}"
S=${WORKDIR}/${ECVS_MODULE}


S=${WORKDIR}/${P}

DEPEND="=x11-libs/qt-3*
	>=media-libs/freetype-2.1
	>=media-libs/lcms-1.09
	>=media-libs/libart_lgpl-2.3.8
	sys-libs/zlib
	>=sys-devel/gcc-3.0.0
	!media-plugins/scribus-svg
	!media-plugins/scribus-scripting"

src_compile() {
	export WANT_AUTOMAKE="1.7" WANT_AUTOCONF="2.5"
	cd  ${WORKDIR}/${ECVS_MODULE}
	make -f Makefile.dist
	econf || die
	emake CXXFLAGS="${CXXFLAGS} -I/usr/include/lcms" || die
}

src_install() {
	export WANT_AUTOMAKE="1.7" WANT_AUTOCONF="2.5"
        cd  ${WORKDIR}/${ECVS_MODULE}
	einstall destdir=${D} || die

	dodoc AUTHORS ChangeLog README TODO

	# Fixing desktop.scribus
	if [ `use kde` ] ; then
		inherit kde-functions
		set-kdedir 3
		sed -e 's/local\///' scribus.desktop > desktop.scribus.2
		echo "Name=Scribus" >> desktop.scribus.2
		cp -f desktop.scribus.2 scribus.desktop
		insinto ${PREFIX}/share/applnk/Graphics
		doins scribus.desktop
	fi

	dosym /usr/share/scribus/doc /usr/share/doc/${PF}/html
}
